<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'My Web Application',

	// preloading 'log' component
	'preload'=>array('log'),
    'language' => 'vi',
    'charset'=>'utf-8', 
	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
        'application.vendors.*',
		'application.components.*',
        'application.modules.rights.*', 
        'application.modules.rights.components.*',
	),
    'theme'=>'classic',
	'modules'=>array(
		// uncomment the following to enable the Gii tool
		
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'acmakhoa',
		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		), 
        //modified by khoaln6 to insert module forum 
         'forum', 
         'shop' => array( 'debug' => 'true'), 
         'rights'=>array( 
            //un-comment if want to install module
            //'install'=>true,
         ),
        //end modified

		
	),
    
    //speed up website
    'onBeginRequest'=>create_function('$event', 'return ob_start("ob_gzhandler");'),
    'onEndRequest'=>create_function('$event', 'return ob_end_flush();'),
    
    
	// application components
	'components'=>array(
		'user'=>array(
        
        
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
            
            // Allows super users access implicitly
            'class'=>'RWebUser',
		),
        'authManager'=>array( 'class'=>'RDbAuthManager',
        ),
         
  
		// uncomment the following to enable URLs in path-format
		 /* 
		'urlManager'=>array(
			'urlFormat'=>'path',
            'showScriptName'=>false,            
            'urlSuffix'=>'.html',
			'rules'=>array(         
                '<_c:(post|comment)>/<_a:(create|update|delete|admin)>' => '<_c>/<_a>',                                       
                'post/<alias:.*>'=>'post/view',
                'posts/<tag:.*>'=>'post/index',                        
                'posts'=>'post/index', 
                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
				
			), 
		),  
        */
        
        
        //using Yii::app()->SMailer
        'SMailer'=>array(
            'class' => 'application.components.SMailer',
            'host'  => 'smtp.gmail.com',
            'username' => 'khoaln6@gmail.com',
            'password' => '1295azvn',
            'port' => '465',
            'secure' => 'ssl'        
        ),
       
        
        // uncomment the following to use a i18n
        'messages'=>array(
            'class'=>'CPhpMessageSource',
        ),
		// uncomment the following to use a MySQL database
		
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=blog',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
            
		),
		
		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'webmaster@example.com',
	),
     
           
);